<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>定制生产派工单</title>
    <!-- Google Font: Source Sans Pro -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/adminlte.min.css">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="../plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
</head>
<body onload="proeandmxxxx()">
<link rel="stylesheet"  href="../css/bootstrap.min.css">
<link rel="stylesheet"  href="../css/bootstrap-table.min.css">
<script src="../js/jquery.min.js" ></script>
<script src="../js/bootstrap.bundle.min.js" ></script>
<script src="../js/bootstrap.min.js"  ></script>
<script src="../js/bootstrap-table.min.js"  ></script>
<script src="../js/bootstrap-table-zh-CN.min.js"></script>
<script src="../js/index.js"></script>
        <h1 style="margin-left: 40%">生产派工单</h1>
        <table id="tab">
            <tr>
                <th>工序编号</th>
                <th>工序名称</th>
                <th>描述</th>
                <th>工时数</th>
                <th>单位工时成本</th>
                <th>工时完成小计</th>
            </tr>
        </table>
        <form action="/scpg/addpg">
            <div class="row">
                <div class="col">
                    工单定制人：<input id="designer" class="form-control">
                </div>
                <div class="col">
                    登记人：<input id="register" class="form-control">
                </div>
            </div>
            <div class="row">
                <div class="col">
                    产品编号：<input id="productId" class="form-control">
                </div>
                <div class="col">
                    产品名：<input id="productName" class="form-control">
                </div>
            </div>
            <div class="row">
                <div class="col">
                    产品数量：<input id="amount" class="form-control">
                </div>
                <div class="col">
                    描述：<input id="productDescribe" class="form-control">
                </div>
               </div>
            <div class="row" style="margin-left: 2%">
                备注: <textarea rows="5" cols="120">

                </textarea>
            </div>
        </form>
            <button class="btn btn-outline-success" onclick="submits()">提交</button>
            <button class="btn btn-outline-dark" onclick="ck()">返回</button>
        <div class="modal" tabindex="-1" role="dialog" id="mydiv">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">工序物料单</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <table id="tabs">
                            <tr>
                                <th>序号</th>
                                <th>物料名</th>
                                <th>物料编号</th>
                                <th>描述</th>
                                <th>数量</th>
                                <th>单位</th>
                                <th>单价</th>
                            </tr>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    <script>
        $("#designer").val(localStorage.getItem("designer"))
        $("#register").val(localStorage.getItem("register"))
        $("#productId").val(localStorage.getItem("productId"))
        $("#productName").val(localStorage.getItem("productName"))
        $("#amount").val(localStorage.getItem("amount"))
        $("#productDescribe").val(localStorage.getItem("productDescribe"))
        $("#id").val(localStorage.getItem("id"))
        function ck() {
            location.href="dzscpgd.html"
        }
        function querymaterial(id) {
            $("#mydiv").show();//这个是查物料，但是物料这边我不清楚，你们在mapper里面去改查找的东西
            $.post("../scjh/querybyids",{"parentId":id},function (date) {
                var table=$("#tabs")
                $(data).each(function (index,item) {
                    var sum=0;
                    sum=item.labourHourAmount*item.subtotal;
                    var tr=$("<tr><td>"+item.id+"</td><td>"+item.procedureName+"</td>" +
                        "<td>"+item.procedureId+"</td><td>"+item.labourHourAmount+"</td>" +
                        "<td>"+item.subtotal+"</td><td>"+sum+"</td>" +
                        "</tr>");
                    table.append(tr);
                })
            },"json")
        }
        function submits() {
            $.post("../scpq/",{"applyIdGroup":$("#id").val()},function (date) {
                //页面没有跳，你们倒是补一下,emmmm而且我做的是修改而不是添加，
                // 到时候你们看着改，做成添加的话可以去scjhgl里面去，哪里也有一个写添加的，复制过来改一下就可以了
            },"json")
        }
    </script>
</body>
</html>